<template>
  <a-modal :visible="visible" title="选择搭配图" width="880px" :footer="null" @cancel="close(false)">
    <div class="list">
      <div class="item" v-for="(item, index) in list" :key="`${item}-${index + 1}`" @click="close(item)">
        <img class="look-img" :src="item" alt="" />
        <a-button type="link">+选用该图</a-button>
      </div>
    </div>
  </a-modal>
</template>
<script>
// import infiniteScroll from 'vue-infinite-scroll';
export default {
  // directives: { infiniteScroll },
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    list:{
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      // visible: true,
      data: [],
      loading: false,
      busy: false,
      
    }
  },
  methods: {
    close(url) {
      this.$emit('confirm', url ? url : '')
    },
  }
}
</script>
<style scoped>
.list {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
}
.item {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  margin-right: 20px;
}
.item:nth-child(5n) {
  margin-right: 0px;
}
.look-img {
  /* width: 100%; */
  width: 150px;
  height: 150px;
  object-fit: contain;
}
.btn {
  width: 100%;
}
</style>
